---
title: clsCreateFileManager / clsMailDateManager.OnWrite
summary: Commit pending create-file or mail-date changes, then submit the shared letter batch.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: submit-letter-batch-after-write
trigger: Create-file or mail-date workflow saves changes.
---

# clsCreateFileManager clsMailDateManager.OnWrite

Commit pending create-file or mail-date changes, then submit the shared letter batch.

| Field | Value |
| --- | --- |
| **Operation ID** | submit-letter-batch-after-write |
| **Trigger** | Create-file or mail-date workflow saves changes. |
| **Inputs** | Current manager state, current claim/case context, and workflow-specific parameters or collections. |
| **Outputs** | Updated collections, messages, or side effects specific to the operation. |
| **Primary components** | `clsCreateFileManager / clsMailDateManager.OnWrite` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsCreateFileManager.vb` |

## Steps

1. Save the pending workflow changes.
2. End the pending transaction explicitly with `DataLayer.DAL.EndTransaction(DPI.PortalID, True)`.
3. Submit the Appworx batch job `LGN0002_LEGALNET_LETTERS` for application `LegalNet`.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
  Start([Trigger]) --> S1[Load current state]
  S1 --> S2[Apply workflow rules]
  S2 --> D{"Validation or security<br>issue?"}
  D -->|Yes| EndErr(["Return message or block<br>action"])
  D -->|No| EndOk(["Return updated workflow<br>state"])
```

## Failure and edge-case behavior
- Batch submission happens only after the transaction has ended successfully.

## Related documentation
- [Index](../index.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Security and authorization](../security-authorization.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [Procedures](../procedures/index.md)
- [API reference](../api/index.md)

## Sources
- SAIF.Application.Claim.Legal\LegalNet\clsCreateFileManager.vb
- - SAIF.Application.Claim.Legal\LegalNet\clsMailDateManager.vb
